home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_05
/
allison
/
person.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-12
|
646b
|
30 lines
LISTING 17 - The Person class implementation
// person.cpp
#include <iostream.h>
#include "person.h"
Person::Person(const string& l, const string& f,
const Date& b, const string& s)
: last(l), first(f), birth(b), ssn(s)
{}
ostream& operator<<(ostream& os, const Person& p)
{
os << '{'
<< p.last << ','
<< p.first << ','
<< '[' << p.birth << ']' << ','
<< p.ssn
<< '}';
return os;
}
bool Person::operator==(const Person & p) const
{
return last == p.last &&
first == p.first &&
birth == p.birth &&
ssn == p.ssn;
}